import axiosHttp from "../../http"

// 将数据插入数据库
async function insertShopMessage(data) {
  console.log(data)
  return axiosHttp({
    url: "/cart/shopmessage",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 查询用户数据库信息
async function selectUserCart(data) {
  console.log(data)
  return axiosHttp({
    url: "/cart/shopusercart",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 删除购物车指定信息
async function delShopMessage(data) {
  console.log(data)
  return axiosHttp({
    url: "/cart/delshopmessage",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 生成订单号
async function orderShop(data) {
  console.log(data)
  return axiosHttp({
    url: "/cart/ordershop",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

export default {
  insertShopMessage,
  selectUserCart,
  delShopMessage,
  orderShop,
}
